
import upload from '@dfeidao/atom-web/file/upload-input';

import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';

import { productid } from '../../atom/config';
export default async function a006(fd: IFeidaoAiBrowserComponent, zta: Event) {
	const node = fd.data.node.querySelector('[data-file="up"]') as HTMLInputElement;
	console.log(node);
	const r1 = await upload(productid, node);
	console.log(r1);
	// console.log(r1[0].filename);
	const src = r1[0].filename;

	// console.log(r1[0].metadata.originialFileName);
	const titlename = r1[0].metadata.originialFileName;
	//  console.log(a.indexOf('.'));
	const b = src.indexOf('.');
	const title = src.substring(0, b);



	set(fd, 'title', title);
	set(fd, 'titlename', titlename);
}


